//
//  BrandDetailCell.m
//  jipin
//
//  Created by lcb on 5/15/15.
//  Copyright (c) 2015 liuchengbin. All rights reserved.
//

#import "BrandDetailCell.h"
@interface BrandDetailCell ()
{
    
}
@property(nonatomic,strong) UILabel *brandKey;
@property(nonatomic,strong) UILabel *brandValue;
@property(nonatomic,strong) UILabel *cityKey;
@property(nonatomic,strong) UILabel *cityValue;
@property(nonatomic,strong) UILabel *dateKey;
@property(nonatomic,strong) UILabel *dateValue;
@property(nonatomic,strong) UILabel *introKey;
@property(nonatomic,strong) UILabel *introValue;
@end
@implementation BrandDetailCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.backgroundColor=[UIColor clearColor];
        _brandKey =[[UILabel alloc] initWithFrame:CGRectMake(PHOTO_TIME_PADDING, PHOTO_TIME_PADDING/2, 40, 20)];
        _brandKey.backgroundColor = [UIColor clearColor];
        _brandKey.textColor = [UIColor darkGrayColor];
        _brandKey.textAlignment = NSTextAlignmentLeft;
        _brandKey.font = FONT(12);
        _brandKey.text =@"品牌:";
        [self.contentView addSubview:_brandKey];
        _brandValue =[[UILabel alloc] initWithFrame:CGRectMake(_brandKey.frame.origin.x+_brandKey.frame.size.width, _brandKey.frame.origin.y, 300, 20)];
        _brandValue.backgroundColor = [UIColor clearColor];
        _brandValue.textColor = [UIColor darkGrayColor];
        _brandValue.textAlignment = NSTextAlignmentLeft;
        _brandValue.font = FONT(12);
        _brandValue.text =@"竹设";
        [self.contentView addSubview:_brandValue];
        _cityKey =[[UILabel alloc] initWithFrame:CGRectMake(_brandKey.frame.origin.x,_brandKey.frame.origin.y+_brandKey.frame.size.height+PHOTO_TIME_PADDING/2, _brandKey.frame.size.width, 20)];
        _cityKey.backgroundColor = [UIColor clearColor];
        _cityKey.textColor = [UIColor darkGrayColor];
        _cityKey.textAlignment = NSTextAlignmentLeft;
        _cityKey.font = FONT(12);
        _cityKey.text =@"国家:";
        [self.contentView addSubview:_cityKey];
        _cityValue =[[UILabel alloc] initWithFrame:CGRectMake(_cityKey.frame.origin.x+_cityKey.frame.size.width, _cityKey.frame.origin.y, 300, 20)];
        _cityValue.backgroundColor = [UIColor clearColor];
        _cityValue.textColor = [UIColor darkGrayColor];
        _cityValue.textAlignment = NSTextAlignmentLeft;
        _cityValue.font = FONT(12);
        _cityValue.text =@"中国";
        [self.contentView addSubview:_cityValue];
        _dateKey =[[UILabel alloc] initWithFrame:CGRectMake(_brandKey.frame.origin.x,_cityKey.frame.origin.y+_cityKey.frame.size.height+PHOTO_TIME_PADDING/2, _brandKey.frame.size.width, 20)];
        _dateKey.backgroundColor = [UIColor clearColor];
        _dateKey.textColor =[UIColor darkGrayColor];
        _dateKey.textAlignment = NSTextAlignmentLeft;
        _dateKey.font = FONT(12);
        _dateKey.text =@"年代:";
        [self.contentView addSubview:_dateKey];
        _dateValue =[[UILabel alloc] initWithFrame:CGRectMake(_dateKey.frame.origin.x+_dateKey.frame.size.width, _dateKey.frame.origin.y, 300, 20)];
        _dateValue.backgroundColor = [UIColor clearColor];
        _dateValue.textColor = [UIColor darkGrayColor];
        _dateValue.textAlignment = NSTextAlignmentLeft;
        _dateValue.font = FONT(12);
        _dateValue.text =@"1985-8-6";
        [self.contentView addSubview:_dateValue];
        _introKey =[[UILabel alloc] initWithFrame:CGRectMake(_brandKey.frame.origin.x,_dateKey.frame.origin.y+_dateKey.frame.size.height+PHOTO_TIME_PADDING/2, _brandKey.frame.size.width, 20)];
        _introKey.backgroundColor = [UIColor clearColor];
        _introKey.textColor = [UIColor darkGrayColor];
        _introKey.textAlignment = NSTextAlignmentLeft;
        _introKey.font = FONT(12);
        _introKey.text =@"简介:";
        [self.contentView addSubview:_introKey];
        _introValue =[[UILabel alloc] initWithFrame:CGRectMake(_introKey.frame.origin.x+_introKey.frame.size.width, _introKey.frame.origin.y, 300, 20)];
        _introValue.backgroundColor = [UIColor clearColor];
        _introValue.textColor =[UIColor darkGrayColor];
        _introValue.textAlignment = NSTextAlignmentLeft;
        _introValue.font = FONT(12);
        _introValue.numberOfLines=0;
        _introValue.text =@"竹设-创意桌面方形的收纳盒 首饰盒/木盒";
        [self.contentView addSubview:_introValue];
        
    }
    return self;
}
-(void)dealloc
{
    self.data=nil;
    self.brandKey=nil;
    self.brandValue=nil;
    self.cityKey=nil;
    self.cityValue=nil;
    self.dateKey=nil;
    self.dateValue=nil;
    self.introKey=nil;
    self.introValue=nil;
//    DLog(@"%s", __PRETTY_FUNCTION__);
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
}
/// 根据数据模型来显示内容
- (void)showInfo:(id)model indexPath:(NSIndexPath *)indexPath
{
    self.indexPath=indexPath;
//    NSDictionary *data =(NSDictionary*)model;
    _brandKey.frame = CGRectMake(PHOTO_FRAME_WIDTH, 0, 40, 20);
    _brandValue.frame = CGRectMake(_brandKey.frame.origin.x+_brandKey.frame.size.width, _brandKey.frame.origin.y, 300, 20);
    _cityKey.frame = CGRectMake(_brandKey.frame.origin.x,_brandKey.frame.origin.y+_brandKey.frame.size.height+PHOTO_TIME_PADDING/2, _brandKey.frame.size.width, 20);
    _cityValue.frame = CGRectMake(_cityKey.frame.origin.x+_cityKey.frame.size.width, _cityKey.frame.origin.y, 300, 20);
    _dateKey.frame = CGRectMake(_brandKey.frame.origin.x,_cityKey.frame.origin.y+_cityKey.frame.size.height+PHOTO_TIME_PADDING/2, _brandKey.frame.size.width, 20);
    _dateValue.frame = CGRectMake(_dateKey.frame.origin.x+_dateKey.frame.size.width, _dateKey.frame.origin.y, 300, 20);
    _introKey.frame = CGRectMake(_brandKey.frame.origin.x,_dateKey.frame.origin.y+_dateKey.frame.size.height+PHOTO_TIME_PADDING/2, _brandKey.frame.size.width, 20);
    _introValue.frame = CGRectMake(_introKey.frame.origin.x+_introKey.frame.size.width, _introKey.frame.origin.y, 300, 20);
    
    [self layoutSubviews];
}
/// 返回Cell高度
+ (CGFloat)returnCellHeight:(id)model
{
    return 80+PHOTO_TIME_PADDING*2;
}
@end

